﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Data;

namespace DataExtractionLanguage
{
    class Program
    {
        static void Main(string[] args)
        {
            string source = "";
            using (FileStream stream = new FileStream(Environment.CurrentDirectory + @"\codeFile1.txt", FileMode.Open))
            using (StreamReader sr = new StreamReader(stream))
                source = sr.ReadToEnd();

            Report report = new Report();
            Output output = new Output();
            ILexical lexer = new Lexical(source);

            SyntaxAnalyzer parser = new SyntaxAnalyzer(lexer, report);
            parser.ReadInstructions();

            ExecutionUnit exeUnit = new ExecutionUnit(report);
            exeUnit.Execute(parser.ParsingTree);

            Console.ReadKey();
        }
    }
}
